<?php
/**
 * 用户相关接口
 */

namespace App\Http\Controllers\App\V3;

use App\Exceptions\BasicException;
use App\Response\Response;
use Illuminate\Http\Request;
use App\Http\Controllers\BaseController;

class UserController extends BaseController
{

    public function outRoomUserCard(Request $request)
    {
        // 参数校验
        $v = app('validator')->make(
            $request->all(),
            [
                'user_id' => "required|numeric|exists:mysql.ln_user,user_id",
            ]
        );

        if ($v->fails()) {
            throw new BasicException(10010, getValidateMessage($v->messages()));
        }

        $params = $request->input();

        $result = app("repo_user")->getOutUserCardData($params['user_id'], UID);

        return Response::sendData($result);
    }

}
